package Server;

import DTO.*;
import Server.BUS.*;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.table.DefaultTableModel;
import Define.*;
import java.sql.SQLException;
import java.util.ArrayList;
import net.sf.jasperreports.engine.JasperPrint;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author Mr
 */
public class QLKS_Implement extends UnicastRemoteObject implements QLKS_Interface {

    private ServerUI ui;

    public QLKS_Implement() throws RemoteException {
    }

    public QLKS_Implement(ServerUI ui) throws RemoteException {
        this.ui = ui;
    }

    @Override
    public boolean KiemTraTonTai(String cmd, String ma) throws RemoteException {
        switch (cmd) {
            case Define.YC_LAYDS_DICHVU:
                try {
                    return DichVu_BUS.kiemTraDichVuCoTrongCTPhieuDichVu(ma);
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case Define.YC_LAYDS_MONAN:
                try {
                    return MonAn_BUS.kiemTraMonAnCoTrongCTPhieuDatTiec(ma);
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
        }
        return false;
    }

    @Override
    public DefaultTableModel LoadTableModel(String tableName) throws RemoteException {
        switch (tableName) {
            case Define.YC_LAYDS_PHONGTRONG:
                try {
                    return Phong_BUS.layDanhSachPhongTrong();
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case Define.YC_LAYDS_PHONGDETHUE:
                try {
                    return Phong_BUS.layDanhSachPhongDeThue();
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case Define.YC_LAYDS_KHACHDATPHONG:
                try {
                    return KhachHang_BUS.layDSKhachDatPhong();
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case Define.YC_LAYDS_PHONG:
                try {
                    return Phong_BUS.layDanhSachPhong();
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case Define.YC_LAYDS_LOAIPHONG:
                try {
                    return LoaiPhong_BUS.layDanhSachLoaiPhong();
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case Define.YC_LAYDS_HUHAI:
                try {
                    return PhieuHuHai_BUS.layDanhSach();
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case Define.YC_LAYDS_DICHVU:
                try {
                    return DichVu_BUS.layBangDichVu();
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case Define.YC_LAYDS_MONAN:
                try {
                    return MonAn_BUS.layBangMonAn();
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case Define.YC_LAYDS_KHACH:
                try {
                    return KhachHang_BUS.layDSKhach();
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
        }
        return null;
    }

    @Override
    public DefaultTableModel LoadTableModel(String tableName, String condition) throws RemoteException {
        switch (tableName) {
            case Define.YC_LAYDS_KHACHDATPHONG:
                try {
                    return KhachHang_BUS.laykhachDatPhong(condition);
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case Define.YC_LAYDS_DICHVU:
                try {
                    return DichVu_BUS.layBangDichVuTheoTen(condition);
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case Define.YC_LAYDS_MONAN:
                try {
                    return MonAn_BUS.layBangMonAnTheoTen(condition);
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case Define.YC_LAYDS_PHONG:
                try {
                    return Phong_BUS.timPhongTheoTenLoaiPhong(condition);
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
        }
        return null;
    }

    @Override
    public DefaultTableModel LoadTableModel(String tableName, Float tu, Float den) throws RemoteException {
        switch (tableName) {
            case Define.YC_LAYDS_MONAN:
                try {
                    return MonAn_BUS.layBangMonAnTheoDonGia(tu, den);
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case Define.YC_LAYDS_DICHVU:
                try {
                    return DichVu_BUS.layBangDichVuTheoDonGia(tu, den);
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
        }
        return null;
    }

    @Override
    public DefaultTableModel LoadTableModel(String tableName, String dk1, String dk2) throws RemoteException {
        switch (tableName) {
            case Define.YC_LAYDS_PHONG:
                try {
                    switch (dk2) {
                        case "ten":
                            return Phong_BUS.timPhongTheoTenLoaiPhong(dk1);
                        case "tinhtrang":
                            return Phong_BUS.timPhongTheoTinhTrang(dk1);
                        default:
                            return Phong_BUS.timPhongTheoTLP_TT(dk1, dk2);
                    }
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case Define.YC_LAYDS_KHACH:
                try {
                    switch (dk2) {
                        case "ten":
                            return KhachHang_BUS.timKhachTheoTen(dk1);
                        case "CMND":
                            return KhachHang_BUS.timKhachTheoCMND(dk1);
                        default:
                            return Phong_BUS.timPhongTheoTLP_TT(dk1, dk2);
                    }
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
        }
        return null;
    }

    @Override
    public ArrayList<LoaiPhong_DTO> LoadDSMaLoaiPhong() throws RemoteException {
        try {
            return LoaiPhong_BUS.layDanhSachMaLoaiPhong();
        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
        }
        return null;
    }

    @Override
    public ArrayList<LoaiPhong_DTO> LoadDSTenLoaiPhong() throws RemoteException {
        try {
            return LoaiPhong_BUS.layDanhSachTenLoaiPhong();
        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
        }
        return null;
    }

    @Override
    public ArrayList<PhieuDatPhong_DTO> layDSMaPhieuDatQuaHan(String today) throws RemoteException {
        try {
            return PhieuDatPhong_BUS.layDSMaPhieuDatQuaHan(today);
        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
        }
        return null;
    }

    @Override
    public ArrayList<Phong_DTO> LayDSPhongDaDat(String maPhieuDat) throws RemoteException {
        try {
            return PhieuDatPhong_BUS.layDSMaPhongDat(maPhieuDat);
        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
        }
        return null;
    }

    @Override
    public ArrayList<KhachHang_DTO> LayDSKhachDangThue() throws RemoteException {
        try {
            return KhachHang_BUS.layKhachDangThue();
        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
        }
        return null;
    }

    @Override
    public ArrayList<CTPhieuThuePhong_DTO> LayDSPhongThue(String maKhach) throws RemoteException {
        try {
            return CTPhieuThuePhong_BUS.layDsPhongThue(maKhach);
        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
        }
        return null;
    }

    @Override
    public String LayTen(String cmd, String ma) throws RemoteException {
        if (Define.YC_LAYTEN_LOAIPHONG.equals(cmd)) {
            try {
                return LoaiPhong_BUS.laytenLoaiPhong(ma);
            } catch (Exception ex) {
                Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        return null;
    }

    @Override
    public String LayMaMax(String cmd) throws RemoteException {
        switch (cmd) {
            case Define.YC_LAYMAMAX_PHIEUDATPHONG:
                try {
                    return PhieuDatPhong_BUS.laymaMax();
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case Define.YC_LAYMAMAX_KHACHHANG:
                try {
                    return KhachHang_BUS.laymaMax();
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case Define.YC_LAYMAMAX_CTPHIEUDATPHONG:
                try {
                    return CTPhieuDatPhong_BUS.laymaMax();
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case Define.YC_LAYMAMAX_PHIEUTHUEPHONG:
                try {
                    return PhieuThuePhong_BUS.laymaMax();
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case Define.YC_LAYMAMAX_CTPHIEUTHUEPHONG:
                try {
                    return CTPhieuThuePhong_BUS.laymaMax();
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case Define.YC_LAYMAMAX_DOANHTHU:
                try {
                    return DoanhThuTheoLoaiPhong_BUS.layMaCuoiCung();
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case Define.YC_LAYMAMAX_HUHAI:
                try {
                    return PhieuHuHai_BUS.laymaMax();
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case Define.YC_LAYMAMAX_HOADON:
                try {
                    return HoaDon_BUS.laymaMax();
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case Define.YC_LAYMAMAX_DICHVU:
                try {
                    return DichVu_BUS.layMaCuoiCung();
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case Define.YC_LAYMAMAX_PHIEUDICHVU:
                try {
                    return PhieuDichVu_BUS.layMaCuoiCung();
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case Define.YC_LAYMAMAX_CTPHIEUDICHVU:
                try {
                    return CTPhieuDichVu_BUS.layMaCuoiCung();
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case Define.YC_LAYMAMAX_MONAN:
                try {
                    return MonAn_BUS.layMaCuoiCung();
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case Define.YC_LAYMAMAX_PHIEUDATTIEC:
                try {
                    return PhieuDatTiec_BUS.layMaCuoiCung();
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case Define.YC_LAYMAMAX_CTPHIEUDATTIEC:
                try {
                    return CTPhieuDatTiec_BUS.layMaCuoiCung();
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            default:
                break;
        }
        return null;
    }

    @Override
    public String LayMaPhieu(String cmd, String condition) throws RemoteException {
        switch (cmd) {
            case Define.YC_LAYMA_PHIEUDATPHONG:
                try {
                    return PhieuDatPhong_BUS.layMaPhieuDat(condition);
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
        }
        return null;
    }

    @Override
    public String LayMaDoanhThu(String maPhong, String condition) throws RemoteException {
        try {
            return DoanhThuTheoLoaiPhong_BUS.layMaDT(maPhong, condition);
        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
        }
        return null;
    }

    @Override
    public String LayMaLoaiPhongTheoMaPhong(String maPhong) throws RemoteException {
        try {
            return Phong_BUS.layMaLPTheoMP(maPhong);
        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
        }
        return null;
    }

    @Override
    public Float LayDoanhThuTheoThangVaLoaiPhong(String thang, String maLoaiPhong) throws RemoteException {
        try {
            return DoanhThuTheoLoaiPhong_BUS.layDoanhThuTheoThangVaLoaiPhong(thang, maLoaiPhong);
        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
        }
        return null;
    }

    @Override
    public String LayTenKHTheoMa(String maKhach) throws RemoteException {
        try {
            return KhachHang_BUS.layTenKHTheoMa(maKhach);
        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
        }
        return null;
    }

    @Override
    public String LaySoDTTheoMa(String maKhach) throws RemoteException {
        try {
            return KhachHang_BUS.laySoDTTheoMa(maKhach);
        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
        }
        return null;
    }

    @Override
    public Float LayTriGiaTheoMaKhach(String cmd, String maKhach) throws RemoteException {
        switch (cmd) {
            case Define.YC_LAYTRIGIA_THUEPHONG:
                try {
                    return PhieuThuePhong_BUS.layTriGiaTheoMaKhach(maKhach);
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case Define.YC_LAYTRIGIA_DATTIEC:
                try {
                    return PhieuDatTiec_BUS.layTriGiaTheoMaKhach(maKhach);
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case Define.YC_LAYTRIGIA_DICHVU:
                try {
                    return PhieuDichVu_BUS.layTriGiaTheoMaKhach(maKhach);
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case Define.YC_LAYTRIGIA_HUHAI:
                try {
                    return PhieuHuHai_BUS.layTriGiaTheoMaKhach(maKhach);
                } catch (Exception ex) {
                    Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
        }
        return null;
    }

    @Override
    public void CapNhatTinhTrangPhong(String maPhong, String tinhTrang) throws RemoteException {
        try {
            Phong_BUS.capnhattinhtrangDat(maPhong, tinhTrang);

        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class
                    .getName()).log(Level.SEVERE, null, ex);
        }
    }

    @Override
    public void CapNhatTinhTrangKhach(String maKhach, String tinhTrang) throws RemoteException {
        try {
            KhachHang_BUS.capNhatTinhTrangKhach(maKhach, tinhTrang);

        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class
                    .getName()).log(Level.SEVERE, null, ex);
        }
    }

    @Override
    public JasperPrint ShowPhieuThuePhong(String maKhach) throws RemoteException {
        try {
            return (new ShowReport().Show_ReportPhieuThue(maKhach));
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(QLKS_Implement.class
                    .getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(QLKS_Implement.class
                    .getName()).log(Level.SEVERE, null, ex);
        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class
                    .getName()).log(Level.SEVERE, null, ex);
        }
        return null;
    }

    @Override
    public JasperPrint ShowHoaDon(String maKhach) throws RemoteException {
        try {
            return (new ShowReport().Show_ReportHoaDon(maKhach));
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(QLKS_Implement.class
                    .getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(QLKS_Implement.class
                    .getName()).log(Level.SEVERE, null, ex);
        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class
                    .getName()).log(Level.SEVERE, null, ex);
        }
        return null;
    }

    @Override
    public JasperPrint ShowBaoCao(String thang) throws RemoteException {
        try {
            return (new ShowReport().Show_ReportDoanhThu(thang));

        } catch (ClassNotFoundException ex) {
            Logger.getLogger(QLKS_Implement.class
                    .getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(QLKS_Implement.class
                    .getName()).log(Level.SEVERE, null, ex);
        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class
                    .getName()).log(Level.SEVERE, null, ex);
        }
        return null;
    }

    @Override
    public JasperPrint ShowPhieuDatTiec(String ma) throws RemoteException {
        try {
            return (new ShowReport().Show_ReportDatTiec(ma));

        } catch (ClassNotFoundException ex) {
            Logger.getLogger(QLKS_Implement.class
                    .getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(QLKS_Implement.class
                    .getName()).log(Level.SEVERE, null, ex);
        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class
                    .getName()).log(Level.SEVERE, null, ex);
        }
        return null;
    }

    @Override
    public void InsertKhachHang(KhachHang_DTO kh) throws RemoteException {
        try {
            KhachHang_BUS.Insert(kh);

        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class
                    .getName()).log(Level.SEVERE, null, ex);
        }
    }

    @Override
    public void InsertPhieuDatPhong(PhieuDatPhong_DTO pdp) throws RemoteException {
        try {
            PhieuDatPhong_BUS.Insert(pdp);

        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class
                    .getName()).log(Level.SEVERE, null, ex);
        }
    }

    @Override
    public void DeletePhieuDatPhong(String ma) throws RemoteException {
        try {
            PhieuDatPhong_BUS.Delete(ma);

        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class
                    .getName()).log(Level.SEVERE, null, ex);
        }
    }

    @Override
    public void InsertCTPhieuDatPhong(CTPhieuDatPhong_DTO ctpdp) throws RemoteException {
        try {
            CTPhieuDatPhong_BUS.Insert(ctpdp);

        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class
                    .getName()).log(Level.SEVERE, null, ex);
        }
    }

    @Override
    public void DeleteCTPhieuDatPhong(String ma) throws RemoteException {
        try {
            CTPhieuDatPhong_BUS.Delete(ma);

        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class
                    .getName()).log(Level.SEVERE, null, ex);
        }
    }

    @Override
    public void InsertLoaiPhong(LoaiPhong_DTO lp) throws RemoteException {
        try {
            LoaiPhong_BUS.Insert(lp);

        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class
                    .getName()).log(Level.SEVERE, null, ex);
        }
    }

    @Override
    public void UpdateLoaiPhong(LoaiPhong_DTO lp) throws RemoteException {
        try {
            LoaiPhong_BUS.Update(lp);

        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class
                    .getName()).log(Level.SEVERE, null, ex);
        }
    }

    @Override
    public void DeleteLoaiPhong(String ma) throws RemoteException {
        try {
            LoaiPhong_BUS.Delete(ma);

        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class
                    .getName()).log(Level.SEVERE, null, ex);
        }
    }

    @Override
    public void InsertPhieuThuePhong(PhieuThuePhong_DTO pt) throws RemoteException {
        try {
            PhieuThuePhong_BUS.Insert(pt);

        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class
                    .getName()).log(Level.SEVERE, null, ex);
        }
    }

    @Override
    public void DeletePhieuThuePhong(String ma) throws RemoteException {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void UpdatePhieuThuePhong(PhieuThuePhong_DTO pt) throws RemoteException {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void InsertCTPhieuThuePhong(CTPhieuThuePhong_DTO ct) throws RemoteException {
        try {
            CTPhieuThuePhong_BUS.Insert(ct);

        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class
                    .getName()).log(Level.SEVERE, null, ex);
        }
    }

    @Override
    public void DeleteCTPhieuThuePhong(String ma) throws RemoteException {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void UpdateCTPhieuThuePhong(CTPhieuThuePhong_DTO ct) throws RemoteException {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void InsertDTTheoLoaiPhong(DoanhThuTheoLoaiPhong_DTO dttlp) throws RemoteException {
        try {
            DoanhThuTheoLoaiPhong_BUS.Insert(dttlp);

        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class
                    .getName()).log(Level.SEVERE, null, ex);
        }
    }

    @Override
    public void DeleteDTTheoLoaiPhong(String ma) throws RemoteException {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void UpdateDTTheoLoaiPhong(DoanhThuTheoLoaiPhong_DTO dttlp) throws RemoteException {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void UpdateDoanhThu(String doanhThu, String maDoanhThu) throws RemoteException {
        try {
            DoanhThuTheoLoaiPhong_BUS.UpdateDoanhThu(doanhThu, maDoanhThu);

        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class
                    .getName()).log(Level.SEVERE, null, ex);
        }
    }

    @Override
    public void InsertHuHai(PhieuHuHai_DTO phh) throws RemoteException {
        try {
            PhieuHuHai_BUS.Insert(phh);

        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class
                    .getName()).log(Level.SEVERE, null, ex);
        }
    }

    @Override
    public void DeleteHuHai(String ma) throws RemoteException {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void UpdateHuHai(PhieuHuHai_DTO phh) throws RemoteException {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void InsertHoaDon(HoaDon_DTO hd) throws RemoteException {
        try {
            HoaDon_BUS.Insert(hd);
        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    @Override
    public void DeleteHoaDon(String ma) throws RemoteException {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void UpdateHoaDon(HoaDon_DTO hd) throws RemoteException {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void InsertDichVu(DichVu_DTO dv) throws RemoteException {
        try {
            DichVu_BUS.Insert(dv);
        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    @Override
    public void DeleteDichVu(String ma) throws RemoteException {
        try {
            DichVu_BUS.Delete(ma);
        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    @Override
    public void UpdateDichVu(DichVu_DTO dv) throws RemoteException {
        try {
            DichVu_BUS.Update(dv);
        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    @Override
    public void InsertPhieuDichVu(PhieuDichVu_DTO pdv) throws RemoteException {
        try {
            PhieuDichVu_BUS.Insert(pdv);
        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    @Override
    public void DeletePhieuDichVu(String ma) throws RemoteException {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void UpdatePhieuDichVu(PhieuDichVu_DTO pdv) throws RemoteException {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void InsertCTPhieuDichVu(CTPhieuDichVu_DTO pctdv) throws RemoteException {
        try {
            CTPhieuDichVu_BUS.Insert(pctdv);
        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    @Override
    public void DeleteCTPhieuDichVu(String ma) throws RemoteException {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void UpdateCTPhieuDichVu(CTPhieuDichVu_DTO pctdv) throws RemoteException {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void InsertMonAn(MonAn_DTO ma) throws RemoteException {
        try {
            MonAn_BUS.Insert(ma);
        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    @Override
    public void DeleteMonAn(String ma) throws RemoteException {
        try {
            MonAn_BUS.Delete(ma);
        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    @Override
    public void UpdateMonAn(MonAn_DTO ma) throws RemoteException {
        try {
            MonAn_BUS.Update(ma);
        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    @Override
    public void InsertPhieuDatTiec(PhieuDatTiec_DTO pdt) throws RemoteException {
        try {
            PhieuDatTiec_BUS.Insert(pdt);
        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    @Override
    public void DeletePhieuDatTiec(String ma) throws RemoteException {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void UpdatePhieuDatTiec(PhieuDatTiec_DTO pdt) throws RemoteException {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void InsertCTPhieuDatTiec(CTPhieuDatTiec_DTO pctdt) throws RemoteException {
        try {
            CTPhieuDatTiec_BUS.Insert(pctdt);
        } catch (Exception ex) {
            Logger.getLogger(QLKS_Implement.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    @Override
    public void DeleteCTPhieuDatTiec(String ma) throws RemoteException {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void UpdateCTPhieuDatTiec(CTPhieuDatTiec_DTO pctdt) throws RemoteException {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

}
